package com.springboot.properties.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Desc:
 * @Date: 2020-07-10
 * @Version:v1.0
 */
@RestController
public class PropertiesController {

    @Value("${my.name}")
    private String myName;

    @Value("${my.age}")
    private int age;

    @RequestMapping("/hello")
    public String readProperties() {
        return "Hello, SpringBoot-Properties, name:" + myName + ";age:" + age;
    }
}
